namespace Romer
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class RomeR : Form
    {
        private Button button1;
        private Button button2;
        private Button button3;
        private CheckBox checkBox1;
        private ComboBox comboBox1;
        private IContainer components;
        private Label CountryCode;
        private Label CRC;
        private PictureBox EditBitmap;
        private TextBox EditCountryCode;
        private TextBox EditEmbedTitle;
        private TextBox EditRomTitle;
        private Label EmbTitle;
        private ToolStripMenuItem exitToolStripMenuItem;
        private ToolStripMenuItem exitToolStripMenuItem1;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private ToolStripMenuItem helpToolStripMenuItem;
        private Label lab;
        private Label label1;
        private Label label2;
        private Label label4;
        private Label label5;
        private Label label7;
        private Label label8;
        private Label label9;
        private MenuStrip menuStrip1;
        public Bitmap myBitmap = new Bitmap(0x20, 0x20);
        private OpenFileDialog openFileBmp;
        private OpenFileDialog openFileDialog1;
        private ToolStripMenuItem openToolStripMenuItem;
        private ToolStripMenuItem openToolStripMenuItem1;
        private ToolStripMenuItem optionsToolStripMenuItem;
        private ToolStripMenuItem patchPrefrencesToolStripMenuItem;
        private PictureBox pictureBox1;
        private TextBox RomFile;
        private Label RomTitle;
        private ToolStripMenuItem selectBitmapToolStripMenuItem;
        private ToolStripMenuItem toolStripMenuItem1;

        public RomeR()
        {
            this.InitializeComponent();
        }

        public void button1_Click(object sender, EventArgs e)
        {
            this.OpenRom();
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            if (this.RomFile.Text != "")
            {
                bool flag;
                bool flag2;
                NdsIconBuilder builder = new NdsIconBuilder {
                    NdsFile = this.RomFile.Text
                };
                ROMEditor editor = new ROMEditor();
                builder.NewEmbedTitle = this.EditEmbedTitle.Text;
                builder.NewRomTitle = this.EditRomTitle.Text;
                builder.NewCountryCode = this.EditCountryCode.Text;
                if (this.openFileBmp.FileName != "")
                {
                    Bitmap inputImage = new Bitmap(this.openFileBmp.FileName);
                    flag2 = builder.BuildNdsIcon(inputImage);
                }
                else if (!this.checkBox1.Checked)
                {
                    flag2 = builder.BuildNdsIconNoImage();
                }
                else
                {
                    MessageBox.Show("ERROR: No image selected for homebrew", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }
                editor.Philsbyte = builder.RAWIcon;
                if (this.checkBox1.Checked)
                {
                    flag = true;
                    this.checkBox1.Checked = false;
                    editor.NdsFile = this.RomFile.Text;
                    editor.FileWritePoint();
                    editor.WriteBannerStart();
                }
                else
                {
                    editor.NdsFile = this.RomFile.Text;
                    flag = false;
                }
                if (flag2)
                {
                    int[] numArray = new int[2];
                    numArray = editor.FileWritePoint();
                    editor.AppendIcon(flag, numArray[1]);
                    builder.NdsFile = this.RomFile.Text;
                    builder.FixHeaderAndLogoCRC();
                    this.RefreshIcon();
                    MessageBox.Show("ROM Edited");
                }
            }
            else
            {
                MessageBox.Show("ERROR: No file selected", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (this.openFileBmp.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Bitmap bitmap = new Bitmap(this.openFileBmp.FileName);
                    this.EditBitmap.Image = bitmap;
                }
                catch
                {
                    MessageBox.Show("ERROR: Image format not supported", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            NdsIcon icon = new NdsIcon {
                NdsFile = this.RomFile.Text
            };
            NdsIconBuilder builder = new NdsIconBuilder {
                NdsFile = this.RomFile.Text
            };
            Bitmap bitmap = new Bitmap(0x20, 0x20);
            icon.GetBounds();
            icon.GetPallete();
            icon.GetTile();
            bitmap = icon.GetIcon();
            this.pictureBox1.Image = bitmap;
            this.EmbTitle.Text = icon.GetTitle(icon.GetIdex(Convert.ToString(this.comboBox1.SelectedText)));
        }

        private void button4_Click_1(object sender, EventArgs e)
        {
            int num = 0x4762;
            int num2 = num % 0x200;
            int[] numArray = new int[] { num, num2 };
            MessageBox.Show(Convert.ToString(numArray[0] + " and " + numArray[1]));
        }

        private void button4_Click_2(object sender, EventArgs e)
        {
            ulong num = 0x4000L;
            MessageBox.Show(Convert.ToString(num));
            num = 0x7fffL;
            MessageBox.Show(Convert.ToString(num));
            num = 0x3fffL;
            MessageBox.Show(Convert.ToString(num));
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            NdsIcon icon = new NdsIcon();
            icon.GetBounds();
            this.EmbTitle.Text = icon.GetTitle(icon.GetIdex(Convert.ToString(this.comboBox1.SelectedText)));
        }

        private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void EditCountryCode_TextChanged(object sender, EventArgs e)
        {
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Close();
        }

        public void Form1_Load(object sender, EventArgs e)
        {
        }

        private void InitializeComponent()
        {
            this.openFileDialog1 = new OpenFileDialog();
            this.button1 = new Button();
            this.RomFile = new TextBox();
            this.label1 = new Label();
            this.pictureBox1 = new PictureBox();
            this.groupBox1 = new GroupBox();
            this.comboBox1 = new ComboBox();
            this.checkBox1 = new CheckBox();
            this.label8 = new Label();
            this.CRC = new Label();
            this.lab = new Label();
            this.CountryCode = new Label();
            this.EmbTitle = new Label();
            this.RomTitle = new Label();
            this.label4 = new Label();
            this.label2 = new Label();
            this.groupBox2 = new GroupBox();
            this.button3 = new Button();
            this.button2 = new Button();
            this.label9 = new Label();
            this.EditCountryCode = new TextBox();
            this.label7 = new Label();
            this.label5 = new Label();
            this.EditBitmap = new PictureBox();
            this.EditEmbedTitle = new TextBox();
            this.EditRomTitle = new TextBox();
            this.openFileBmp = new OpenFileDialog();
            this.menuStrip1 = new MenuStrip();
            this.toolStripMenuItem1 = new ToolStripMenuItem();
            this.openToolStripMenuItem1 = new ToolStripMenuItem();
            this.exitToolStripMenuItem1 = new ToolStripMenuItem();
            this.optionsToolStripMenuItem = new ToolStripMenuItem();
            this.selectBitmapToolStripMenuItem = new ToolStripMenuItem();
            this.patchPrefrencesToolStripMenuItem = new ToolStripMenuItem();
            this.helpToolStripMenuItem = new ToolStripMenuItem();
            this.openToolStripMenuItem = new ToolStripMenuItem();
            this.exitToolStripMenuItem = new ToolStripMenuItem();
            ((ISupportInitialize) this.pictureBox1).BeginInit();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            ((ISupportInitialize) this.EditBitmap).BeginInit();
            this.menuStrip1.SuspendLayout();
            base.SuspendLayout();
            this.openFileDialog1.FileName = "openFileDialog1";
            this.openFileDialog1.Filter = "NDS Files (*.nds)|*.nds";
            this.button1.Location = new Point(0x166, 0x16);
            this.button1.Name = "button1";
            this.button1.Size = new Size(0x3f, 20);
            this.button1.TabIndex = 0;
            this.button1.Text = "Browse..";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new EventHandler(this.button1_Click);
            this.RomFile.Location = new Point(0x2d, 0x17);
            this.RomFile.Name = "RomFile";
            this.RomFile.Size = new Size(0x133, 20);
            this.RomFile.TabIndex = 1;
            this.label1.AutoSize = true;
            this.label1.Location = new Point(13, 0x1a);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x1a, 13);
            this.label1.TabIndex = 2;
            this.label1.Text = "File:";
            this.pictureBox1.BackColor = SystemColors.InactiveBorder;
            this.pictureBox1.BorderStyle = BorderStyle.Fixed3D;
            this.pictureBox1.Location = new Point(0x148, 0x6b);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Size(0x40, 0x40);
            this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            this.pictureBox1.TabIndex = 4;
            this.pictureBox1.TabStop = false;
            this.groupBox1.Controls.Add(this.comboBox1);
            this.groupBox1.Controls.Add(this.checkBox1);
            this.groupBox1.Controls.Add(this.label8);
            this.groupBox1.Controls.Add(this.CRC);
            this.groupBox1.Controls.Add(this.lab);
            this.groupBox1.Controls.Add(this.CountryCode);
            this.groupBox1.Controls.Add(this.EmbTitle);
            this.groupBox1.Controls.Add(this.RomTitle);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.button1);
            this.groupBox1.Controls.Add(this.pictureBox1);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.RomFile);
            this.groupBox1.Location = new Point(11, 0x1b);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x1ac, 0xb3);
            this.groupBox1.TabIndex = 5;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Rom";
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Location = new Point(0x149, 80);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new Size(0x47, 0x15);
            this.comboBox1.TabIndex = 0x12;
            this.comboBox1.Visible = false;
            this.checkBox1.AutoSize = true;
            this.checkBox1.Location = new Point(0x13e, 0x39);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new Size(0x63, 0x11);
            this.checkBox1.TabIndex = 0x11;
            this.checkBox1.Text = "Homebrew App";
            this.checkBox1.UseVisualStyleBackColor = true;
            this.label8.AutoSize = true;
            this.label8.Location = new Point(13, 0x85);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x42, 13);
            this.label8.TabIndex = 0x10;
            this.label8.Text = "Game Code:";
            this.CRC.BackColor = SystemColors.InactiveBorder;
            this.CRC.BorderStyle = BorderStyle.Fixed3D;
            this.CRC.Location = new Point(0x6b, 0x9b);
            this.CRC.Name = "CRC";
            this.CRC.Size = new Size(0xba, 0x10);
            this.CRC.TabIndex = 12;
            this.lab.AutoSize = true;
            this.lab.Location = new Point(13, 0x9e);
            this.lab.Name = "lab";
            this.lab.Size = new Size(0x47, 13);
            this.lab.TabIndex = 6;
            this.lab.Text = "Header Valid:";
            this.CountryCode.BackColor = SystemColors.InactiveBorder;
            this.CountryCode.BorderStyle = BorderStyle.Fixed3D;
            this.CountryCode.Location = new Point(0x6b, 130);
            this.CountryCode.Name = "CountryCode";
            this.CountryCode.Size = new Size(0xba, 0x10);
            this.CountryCode.TabIndex = 15;
            this.EmbTitle.BackColor = SystemColors.InactiveBorder;
            this.EmbTitle.BorderStyle = BorderStyle.Fixed3D;
            this.EmbTitle.Location = new Point(0x6b, 0x4e);
            this.EmbTitle.Name = "EmbTitle";
            this.EmbTitle.Size = new Size(0xba, 0x2b);
            this.EmbTitle.TabIndex = 11;
            this.RomTitle.BackColor = SystemColors.InactiveBorder;
            this.RomTitle.BorderStyle = BorderStyle.Fixed3D;
            this.RomTitle.Location = new Point(0x6b, 0x39);
            this.RomTitle.Name = "RomTitle";
            this.RomTitle.Size = new Size(0xba, 0x10);
            this.RomTitle.TabIndex = 10;
            this.label4.AutoSize = true;
            this.label4.Location = new Point(13, 0x4e);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x4e, 13);
            this.label4.TabIndex = 7;
            this.label4.Text = "Embeded Title:";
            this.label2.AutoSize = true;
            this.label2.Location = new Point(13, 0x39);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x3a, 13);
            this.label2.TabIndex = 5;
            this.label2.Text = "ROM Title:";
            this.groupBox2.Controls.Add(this.button3);
            this.groupBox2.Controls.Add(this.button2);
            this.groupBox2.Controls.Add(this.label9);
            this.groupBox2.Controls.Add(this.EditCountryCode);
            this.groupBox2.Controls.Add(this.label7);
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this.EditBitmap);
            this.groupBox2.Controls.Add(this.EditEmbedTitle);
            this.groupBox2.Controls.Add(this.EditRomTitle);
            this.groupBox2.Location = new Point(12, 0xe0);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0x1ab, 0x98);
            this.groupBox2.TabIndex = 6;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Edit Rom";
            this.button3.Location = new Point(0x12a, 0x5b);
            this.button3.Name = "button3";
            this.button3.Size = new Size(0x76, 0x17);
            this.button3.TabIndex = 12;
            this.button3.Text = "Select Bitmap";
            this.button3.UseVisualStyleBackColor = true;
            this.button3.Click += new EventHandler(this.button3_Click);
            this.button2.Location = new Point(0x12a, 120);
            this.button2.Name = "button2";
            this.button2.Size = new Size(0x76, 0x17);
            this.button2.TabIndex = 11;
            this.button2.Text = "Apply Changes";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new EventHandler(this.button2_Click_1);
            this.label9.AutoSize = true;
            this.label9.Location = new Point(13, 0x7b);
            this.label9.Name = "label9";
            this.label9.Size = new Size(0x42, 13);
            this.label9.TabIndex = 9;
            this.label9.Text = "Game Code:";
            this.EditCountryCode.CharacterCasing = CharacterCasing.Upper;
            this.EditCountryCode.Location = new Point(0x6b, 120);
            this.EditCountryCode.MaxLength = 4;
            this.EditCountryCode.Name = "EditCountryCode";
            this.EditCountryCode.Size = new Size(0xb9, 20);
            this.EditCountryCode.TabIndex = 3;
            this.EditCountryCode.TextChanged += new EventHandler(this.EditCountryCode_TextChanged);
            this.label7.AutoSize = true;
            this.label7.Location = new Point(13, 50);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x4e, 13);
            this.label7.TabIndex = 8;
            this.label7.Text = "Embeded Title:";
            this.label5.AutoSize = true;
            this.label5.Location = new Point(13, 0x18);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x37, 13);
            this.label5.TabIndex = 7;
            this.label5.Text = "Rom Title:";
            this.EditBitmap.BackColor = SystemColors.InactiveBorder;
            this.EditBitmap.BorderStyle = BorderStyle.Fixed3D;
            this.EditBitmap.Location = new Point(0x148, 0x13);
            this.EditBitmap.Name = "EditBitmap";
            this.EditBitmap.Size = new Size(0x40, 0x40);
            this.EditBitmap.SizeMode = PictureBoxSizeMode.StretchImage;
            this.EditBitmap.TabIndex = 2;
            this.EditBitmap.TabStop = false;
            this.EditEmbedTitle.Location = new Point(0x6b, 0x2f);
            this.EditEmbedTitle.MaxLength = 0x80;
            this.EditEmbedTitle.Multiline = true;
            this.EditEmbedTitle.Name = "EditEmbedTitle";
            this.EditEmbedTitle.Size = new Size(0xb9, 0x43);
            this.EditEmbedTitle.TabIndex = 1;
            this.EditRomTitle.CharacterCasing = CharacterCasing.Upper;
            this.EditRomTitle.Location = new Point(0x6a, 0x15);
            this.EditRomTitle.MaxLength = 12;
            this.EditRomTitle.Name = "EditRomTitle";
            this.EditRomTitle.Size = new Size(0xba, 20);
            this.EditRomTitle.TabIndex = 0;
            this.openFileBmp.Filter = "Image Files(*.BMP;*.PNG;*.GIF)|*.BMP;*.PNG;*.GIF|All files (*.*)|*.*";
            this.openFileBmp.FileOk += new CancelEventHandler(this.openFileBmp_FileOk);
            this.menuStrip1.Items.AddRange(new ToolStripItem[] { this.toolStripMenuItem1, this.optionsToolStripMenuItem, this.helpToolStripMenuItem });
            this.menuStrip1.Location = new Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new Size(0x1c4, 0x18);
            this.menuStrip1.TabIndex = 7;
            this.menuStrip1.Text = "menuStrip1";
            this.toolStripMenuItem1.DropDownItems.AddRange(new ToolStripItem[] { this.openToolStripMenuItem1, this.exitToolStripMenuItem1 });
            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
            this.toolStripMenuItem1.Size = new Size(0x23, 20);
            this.toolStripMenuItem1.Text = "File";
            this.openToolStripMenuItem1.Name = "openToolStripMenuItem1";
            this.openToolStripMenuItem1.Size = new Size(0x98, 0x16);
            this.openToolStripMenuItem1.Text = "Open";
            this.openToolStripMenuItem1.Click += new EventHandler(this.openToolStripMenuItem1_Click);
            this.exitToolStripMenuItem1.Name = "exitToolStripMenuItem1";
            this.exitToolStripMenuItem1.Size = new Size(0x98, 0x16);
            this.exitToolStripMenuItem1.Text = "Exit";
            this.exitToolStripMenuItem1.Click += new EventHandler(this.exitToolStripMenuItem1_Click);
            this.optionsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { this.selectBitmapToolStripMenuItem, this.patchPrefrencesToolStripMenuItem });
            this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
            this.optionsToolStripMenuItem.Size = new Size(0x38, 20);
            this.optionsToolStripMenuItem.Text = "Options";
            this.selectBitmapToolStripMenuItem.Name = "selectBitmapToolStripMenuItem";
            this.selectBitmapToolStripMenuItem.Size = new Size(0x8a, 0x16);
            this.selectBitmapToolStripMenuItem.Text = "Select Bitmap";
            this.selectBitmapToolStripMenuItem.Click += new EventHandler(this.selectBitmapToolStripMenuItem_Click);
            this.patchPrefrencesToolStripMenuItem.Name = "patchPrefrencesToolStripMenuItem";
            this.patchPrefrencesToolStripMenuItem.Size = new Size(0x8a, 0x16);
            this.patchPrefrencesToolStripMenuItem.Text = "Settings";
            this.patchPrefrencesToolStripMenuItem.Click += new EventHandler(this.patchPrefrencesToolStripMenuItem_Click);
            this.openToolStripMenuItem.Name = "openToolStripMenuItem";
            this.openToolStripMenuItem.Size = new Size(100, 0x16);
            this.openToolStripMenuItem.Text = "Open";
            this.openToolStripMenuItem.Click += new EventHandler(this.openToolStripMenuItem_Click);
            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
            this.exitToolStripMenuItem.Size = new Size(100, 0x16);
            this.exitToolStripMenuItem.Text = "Exit";
            this.exitToolStripMenuItem.Click += new EventHandler(this.exitToolStripMenuItem_Click);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            this.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x1c4, 0x184);
            base.Controls.Add(this.groupBox2);
            base.Controls.Add(this.groupBox1);
            base.Controls.Add(this.menuStrip1);
            base.MaximizeBox = false;
            this.MaximumSize = new Size(460, 0x1a6);
            this.MinimumSize = new Size(460, 0x1a6);
            base.Name = "RomeR";
            this.SizeGripStyle = SizeGripStyle.Hide;
            this.Text = "NDS Banner Editor";
            base.Load += new EventHandler(this.Form1_Load);
            ((ISupportInitialize) this.pictureBox1).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((ISupportInitialize) this.EditBitmap).EndInit();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void openFileBmp_FileOk(object sender, CancelEventArgs e)
        {
        }

        private void OpenRom()
        {
            if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                this.openFileBmp.FileName = "";
                this.RomFile.Text = this.openFileDialog1.FileName;
                NdsIcon icon = new NdsIcon {
                    NdsFile = this.RomFile.Text
                };
                icon.GetBounds();
                icon.GetPallete();
                icon.GetTile();
                this.myBitmap = icon.GetIcon();
                this.pictureBox1.Image = this.myBitmap;
                this.EditBitmap.Image = this.myBitmap;
                this.EmbTitle.Text = icon.GetTitle(icon.GetIdex(Convert.ToString(this.comboBox1.SelectedText))).TrimEnd(new char[] { ' ' });
                this.CRC.Text = Convert.ToString(icon.CheckHeaderCRC());
                this.RomTitle.Text = icon.GetROMTitle().TrimEnd(new char[] { ' ' });
                this.CountryCode.Text = icon.GetCountryCode().TrimEnd(new char[] { ' ' });
                this.EditEmbedTitle.Text = this.EmbTitle.Text;
                this.EditCountryCode.Text = this.CountryCode.Text;
                this.EditRomTitle.Text = this.RomTitle.Text;
                if (icon.Homebrew)
                {
                    this.checkBox1.Checked = true;
                }
            }
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.OpenRom();
        }

        private void openToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.OpenRom();
        }

        private void patchPrefrencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new Options().ShowDialog();
        }

        private void RefreshIcon()
        {
            NdsIcon icon = new NdsIcon {
                NdsFile = this.RomFile.Text
            };
            icon.GetBounds();
            icon.GetPallete();
            icon.GetTile();
            this.myBitmap = icon.GetIcon();
            this.pictureBox1.Image = this.myBitmap;
            this.EditBitmap.Image = this.myBitmap;
            this.EmbTitle.Text = icon.GetTitle(icon.GetIdex(Convert.ToString(this.comboBox1.SelectedText))).TrimEnd(new char[] { ' ' });
            this.CRC.Text = Convert.ToString(icon.CheckHeaderCRC());
            this.RomTitle.Text = icon.GetROMTitle().TrimEnd(new char[] { ' ' });
            this.CountryCode.Text = icon.GetCountryCode().TrimEnd(new char[] { ' ' });
            this.EditEmbedTitle.Text = this.EmbTitle.Text;
            this.EditCountryCode.Text = this.CountryCode.Text;
            this.EditRomTitle.Text = this.RomTitle.Text;
        }

        private void selectBitmapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.openFileBmp.ShowDialog() == DialogResult.OK)
            {
                this.EditBitmap.ImageLocation = this.openFileBmp.FileName;
                Bitmap bitmap = new Bitmap(this.openFileBmp.FileName);
                this.EditBitmap.Image = bitmap;
            }
        }
    }
}

